import request from '../../utils/request';
import Constants from '../../utils/Constants';


/**
 * 预约下单相关服务
 */


/**
 *  分页查询预约下单记录
 *
 * @param lesseeCode
 * @param lesseeName
 * @param status
 * @param page
 */
export async function getBookOrderList({productname, customerno, companyname, status, page}) {
    return request(apiPath.mc + "/api/bookorderrecords", {
        method: 'get',
        data: {productname, customerno, companyname, status, page: page.page, size: page.size}
    });
}


/**
 * 预约下单审核
 * @param id
 * @param approvalresult
 * @param approvalmemo
 */
export async function approvalBookOrder({id, approvalresult, approvalmemo}) {
    let entityid = id;
    return request(apiPath.mc + "/api/bookorderrecord/" + id +"/approval", {
        method: 'post',
        data: {approvalresult, approvalmemo, entityid}
    });
}


/**
 * 删除预约下单s
 * @param id
 */
export async function deleteBookOrderById({id}) {
    return request(apiPath.mc + "/api/bookorderrecord/" + id, {
        method: 'delete'
    });
}

/**
 * 获取预约下单详情
 * @param id
 */
export async function getBookOrderById({id}) {
    return request(apiPath.mc + "/api/bookorderrecord/" + id, {
        method: 'get'
    });
}

/**
 * 获取审核记录
 * @param cstId
 * @returns {Promise.<void>}
 */
export async function getApprovaList({id}) {
    return request(apiPath.mc + "/api/bookorderrecord/" + id + "/approval", {
        method: 'get',
    });

}
